FE refacter#272
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isDeepEqualをutils/deepEqual.tsに集約し、useCareerDirty/useProjectFormDirtyの byte 一致コピペを解消(等価判定の乖離リスクを除去)。useAsyncTaskPageの未参照デッドコードgetNextIntervalを削除(バックオフはuseTaskPollingが実装済み)。useCareerExperienceMutatorsに単体テストを新規追加し、フォーム state を書き換える仕様分岐(is_current↔end_date / has_client↔name / 最後の1件削除ガード / onProjectSave 追加・置換)を固定。useTaskPolling.testのフレーキーな実時間待ち(setTimeout)を fake timers ベースへ置換し、unmount でポーリングが止まる仕様を決定論的に検証。Applied Changes
High
Medium
isDeepEqualを移設(Findings Medium / Duplication High「isDeepEqual の byte 一致コピペ」)。../../utils/deepEqualから import。挙動不変。diffProject/ team・technology_stacks・phases 比較はそのまま共通関数を利用。Low
getNextIntervalの定義・export・「将来の拡張用」コメントを削除(Findings Low「デッドコード export」)。rg getNextInterval src/で参照ゼロを確認済み。blog/+career/)へ更新。存在しないuseBlogSummaryPolling/useCareerAnalysisPage/useAsyncAnalysisPage/analysis/記載を削除し、未記載だったuseAsyncTaskPage/useAuthSessionを追記。pages/から削除済みCareerAnalysisPage.tsx、components/career-analysis/ディレクトリ記載を削除。api/モジュール一覧から削除済みcareer-analysis/intelligenceを除き、実在のgithubLinkを追記。utils/に新規deepEqual.tsと既存未記載のpdfjs.ts/taskStatus.tsを追記。useAsyncAnalysisPage→useAsyncTaskPageに修正。Test Changes
Removed
Added
Changed
await new Promise((r)=>setTimeout(r, FAST_INTERVAL*3))の実時間待ちをvi.useFakeTimers()+vi.advanceTimersByTimeAsyncに変更。マウント中は反復(呼び出し ≥2)→ unmount → 仮想時間を進めても呼び出しが増えないことを決定論的に検証。守る仕様(unmount でポーリング停止)は維持。Duplication Resolved
useCareerDirty.ts:72-96↔useProjectFormDirty.ts:30-54のisDeepEqual(27L clone)」を統合。抽出先は duplication.md「Frontend → 純粋関数は src/utils/」に準拠。両 hook は import 1 行に置換し、再帰等価判定の正本を 1 か所に集約。useCareerExperienceMutatorsの nested setForm パターン、テストの arrange-act-assert 群)は偶発的重複として抽出せず維持(Skipped 参照)。Structure Changes
utils/deepEqual.tsを新設したのみ。ディレクトリ移動・hook 切り出しなし(レポートの Oversized 3 件は全て「現状維持推奨」)。Skipped
useCareerExperienceMutatorsの experience/client/project 別 nested updater、jscpd 検出のテスト arrange-act-assert 13 件)は duplication.md「許容される類似」に該当するため抽出しない。Validation
make lint-frontend: pass(eslint src/ エラーなし)make lint-frontend-messages: pass(grep ベース検知ゼロ)make test-frontend: pass(node:test 4 / vitest 22 ファイル 160 tests 全 green。新規 useCareerExperienceMutators.test.ts 含む)make build-frontend: pass(tsc -b + vite build、220 modules、型エラーなし)npm run test:e2e): 未実行。理由: 新規ページ/ルート追加・認証/ナビゲーション/レイアウト/サイドバー変更・UI フローに影響する API 変更のいずれにも該当しない(util 抽出は挙動不変、デッドコード削除、テストのみの変更)。Follow-ups